package com.quanyan.authority.constants;

/**
 * Created by Administrator on 2016/8/4.
 */
public class AuthorityConstants {

    /**
     * 管理员编码
     */
    public static final String ROLE_CODE_ADMIN = "ROLE_CODE_ADMIN_MANAGER";

    /**
     * 菜单 角色关系key
     */
    public static final String ROLE_MENU_REDIS_KEY = "AUTHORITY_ROLE_MENU_LIST:";

    /**
     * 菜单key
     */
    public static final String MENU_REDIS_KEY = "MENU_REDIS_KEY_MAP:";

    public static final String USER_SESSION_KEY = "ADMIN_USER_REDIS_KEY:";

    /**
     * 权限角色关系keY
     */
    public static final String ROLE_MAP_KEY = "AUTHORITY_ROLE_MAP_KEY";

    /**
     * 用户角色key
     * @param uid
     * @return
     */
    public static String getUserRoleRedisKey(Integer uid){
        return "USER_ROLE_LIST:" + uid.toString();
    }

    /**
     * 登录成功存取用户key
     */
    public static String ADMIN_USER_REDIS_KEY = "ADMIN_USER_KEY:";


    /**
     * 角色编码key
     */
    public static String ROLE_CODE_KEY_REDIS = "ROLE_CODE_STR_";


    /**
     * 资源类型
     */
    public static final class ResourcesType{

        /**
         * 菜单
         */
        public static final byte menu = 1;

        /**
         * 功能
         */
        public static final byte function = 2;

        /**
         * 权限
         */
        public static final byte project = 3;

    }
}
